﻿using NHibernate;

namespace ScrumBox.DataAccess
{
    public class RepositoryBase
    {
        private readonly ISessionBuilder _sessionBuilder;

        public RepositoryBase(ISessionBuilder sessionFactory)
        {
            _sessionBuilder = sessionFactory;
        }

        protected ISession getSession()
        {
            return _sessionBuilder.GetSession();
        }

        public void Flush()
        {
            getSession().Flush();
        }
    }
}